<!DOCTYPE html>
 <html>
  <head>
    <title>{$web_title}</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
	<script type="text/javascript" src="/public/novel/js/jquery.min.js"></script>
	<script type="text/javascript" src="/public/layer/layer.js"></script>
	<script src="/public/novel/flexible/flexible_css.js"></script>
	<script src="/public/novel/flexible/flexible.js"></script>
    <link href="/public/activity/template4/shouchong.css" rel="stylesheet">
    
  </head>
  
  <body>
    <div id="root">
      <div class="page">
        <div class="box">
          <div class="logo"></div>
          <div class="banner"></div>
		 
          <div class="product-container">
            <div class="text">首次充值
              <span>{$info.price}元</span>送
              <span>{$info.giveegold/100}元</span></div>
            <div class="text">共得
              <span>{$info.price}阅读币+{$info.giveegold}书币</span></div>
			
          </div>
          <a href="JavaScript:;" data-money='{$info.price}' data-activityid='{$info.id}' data-payid='{$info.payid}' data-userlimit='{$info.user_limit}' class="btn-recharge">点击充值</a>
		 
          <div class="rules">1. 此充值为阅读币充值</div>
          <div class="rules">2. 阅读币为虚拟物品，不支持退货</div>
          <div class="rules">3. 此充值只限单次充值</div>
      </div>
    </div>
    <script type="text/javascript">
		var loginurl = "{$domain}/login?backurl={$backurl}";
		var jumpurl = "{$domain}/personal/info";
		var cancelurl = window.location.href;
		var login = {$uid|default=0};
		var payurl = "{:config('agent_payurl')}";
		var pay_change = {:config('pay_change')};
		var paylimit = {$paylimit};
		var paytype = {$paytype};
		
		$(function(){
			$('.btn-recharge').click(function(){
				var money = $(this).data('money');
				var payid = $(this).data("payid");
				var userlimit = $(this).data("userlimit");
				var activityid = $(this).data('activityid');
				var endtime = {$info.endtime|default=0};
				var nowtime = new Date().getTime().toString();
				nowtime = nowtime.substr(0,10);

				if (paylimit>0)
				{
					layer.msg("你已经参加过本次活动!");
					return false;
				}
				if (paytype==1)
				{
					layer.msg("你不是已充值用户，不能参加本次活动!");
					return false;
				}
				if (paytype==2)
				{
					layer.msg("你不是未充值用户，不能参加本次活动!");
					return false;
				}

				if(endtime >nowtime){
					var ua = navigator.userAgent.toLowerCase();
					if(ua.match(/MicroMessenger/i)=="micromessenger") {  
						if (pay_change==1)
						{
							var url = payurl+'/pay/pay.html?egold='+money+'&type=4&activityid='+activityid+'&isactivity=1&jumpurl='+jumpurl+'&cancelurl='+cancelurl+'&payid='+payid+'&userlimit='+userlimit;
						}else{
							var url = payurl+'/pay/thirdpay.html?egold='+money+'&type=4&activityid='+activityid+'&isactivity=1&jumpurl='+jumpurl+'&cancelurl='+cancelurl+'&payid='+payid+'&userlimit='+userlimit;
						}
					} else {  
							var url = payurl+'/alipay/pay.html?egold='+money+'&type=4&activityid='+activityid+'&isactivity=1&jumpurl='+jumpurl+'&cancelurl='+cancelurl+'&payid='+payid+'&userlimit='+userlimit;
					} 

					if(login)
					{
						document.location.href=url
					}else{
						document.location.href=loginurl	
					}
				}else{
					layer.msg("活动已结束!");
				}

			})

		})
		
	</script>	
  </body>
	
</html>